# the extensions name, no trailing spaces in the next line
EXTENSION = pgnetworkflow
EXTVERSION = $(shell grep default_version $(EXTENSION).control | \
			sed -e "s/default_version[[:space:]]*=[[:space:]]*'\([^']*\)'/\1/")

#DATA = sql/pgnetworkflow--0.0.1.sql  # script files to install
#DATA = $(filter-out $(wildcard sql/*--*.sql))
#DOCS = $(wildcard doc/*.md)
REGRESS = pgnetworkflow_test     # our test script file (without extension)
#MODULES = pgnetworkflow          # our c module file to build
#a shared library to build from multiple source files (list object files in OBJS)
OBJS = mincost/my_func.o mincost/input.o mincost/mincost_pg.o mincost/mincost_ns.o \
       common/pg_io.o

MODULE_big =  pgnetworkflow

#an executable program to build (list object files in OBJS)
#PROGRAM = mincost.o main.o my_main

#PG_CPPFLAGS = -I/opt/lemon/include/
#PG_CXXFLAGS = -std=c++2a
SHLIB_LINK = -llemon #-L/opt/lemon/lib/

# postgres build stuff
PG_CONFIG = pg_config

all: sql/$(EXTENSION)--$(EXTVERSION).sql

sql/$(EXTENSION)--$(EXTVERSION).sql: sql/ext.sql mincost/mincost.sql
	cat $^ > $@

DATA = $(wildcard updates/*--*.sql) sql/$(EXTENSION)--$(EXTVERSION).sql

EXTRA_CLEAN = sql/$(EXTENSION)--$(EXTVERSION).sql

PGXS := $(shell $(PG_CONFIG) --pgxs)
include $(PGXS)
